home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1990-1992 by Michael Davidson.
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software
- * and its documentation for any purpose and without fee is hereby
- * granted, provided that the above copyright notice appear in all
- * copies and that both that copyright notice and this permission
- * notice appear in supporting documentation.
- *
- * This software is provided "as is" without express or implied warranty.
- */
-
- #ifndef VESABIOS_H
- #define VESABIOS_H
-
- #include "v86types.h"
-
- /*
- * definitions for VESA BIOS extensions
- */
-
- /*
- * VESA BIOS INT 10 subfunctions
- */
- #define VESA_INFO 0x4f00
- #define VESA_MODE_INFO 0x4f01
- #define VESA_SET_MODE 0x4f02
- #define VESA_GET_MODE 0x4f03
- #define VESA_SAVE_RESTORE 0x4f04
- #define VESA_WINDOW_CONTROL 0x4f05
- #define VESA_SCANLINE 0x4f06
- #define VESA_DISPLAY_START 0x4f07
-
- /*
- * VESA return value in AX
- */
- #define VESA_RETURN_OK 0x004f
-
- /*
- * structure returned by VESA_INFO
- */
- #pragma pack(1)
- struct __VESAInfo
- {
- dword_t signature; /* signature - 'VESA' */
- word_t version; /* version */
- fptr_t vendor_data; /* far pointer to vendor data */
- fptr_t capabilities; /* reserved */
- fptr_t mode_table; /* far pointer to mode table */
- word_t memory_size; /* memory size in 64k blocks */
- byte_t pad[236]; /* pad structure to 256 bytes */
- };
- #pragma pack()
-
- typedef struct __VESAInfo VESAInfo;
-
- #define VESA_SIGNATURE 0x41534556L /* 'VESA' */
-
- #pragma pack(1)
- struct __VESAModeInfo
- {
- word_t attributes; /* mode attributes */
- byte_t window_attributes[2]; /* window attributes */
- word_t window_granularity; /* window granularity in 1K units*/
- word_t window_size; /* window size in 1K units */
- word_t window_seg[2]; /* segment address of window */
- fptr_t window_func; /* far pointer to window func */
- word_t scanline_size; /* bytes per scanline */
- /*** start of optional information ***/
- word_t x_resolution; /* horizontal resolution */
- word_t y_resolution; /* vertical resolution */
- byte_t char_cell_width; /* char cell width (pixels) */
- byte_t char_cell_height; /* char cell height (pixels) */
- byte_t planes; /* # of bit planes */
- byte_t bits_per_pixel; /* # of bits per pixel */
- byte_t banks; /* # of memory banks */
- byte_t model; /* display memory organisation */
- byte_t bank_size; /* bank size in 1K units */
- byte_t display_pages; /* # of display pages */
- byte_t pad0;
- byte_t red_bits;
- byte_t red_shift;
- byte_t green_bits;
- byte_t green_shift;
- byte_t blue_bits;
- byte_t blue_shift;
- byte_t pad[219]; /* pad structure to 256 bytes */
- };
- #pragma pack()
-
- typedef struct __VESAModeInfo VESAModeInfo;
-
- /*
- * VESA mode attribute flags
- */
- #define VESA_MODE_SUPPORTED 0x01 /* this mode supported */
- #define VESA_MODE_OPT_INFO 0x02 /* optional info available */
- #define VESA_MODE_STD_BIOS 0x04 /* standard BIOS support */
- #define VESA_MODE_COLOR 0x08 /* color mode */
- #define VESA_MODE_GRAPHICS 0x10 /* graphics mode */
-
- /*
- * VESA window attribute flags
- */
- #define VESA_WINDOW_EXISTS 0x01 /* window exists */
- #define VESA_WINDOW_READABLE 0x02 /* window is readable */
- #define VESA_WINDOW_WRITEABLE 0x04 /* window is writeable */
-
- /*
- * VESA memory models
- */
- #define VESA_MEM_TEXT 0x00 /* standard text mode */
- #define VESA_MEM_CGA 0x01 /* CGA style graphics mode */
- #define VESA_MEM_HERCULES 0x02 /* Hercules style graphics mode */
- #define VESA_MEM_4PLANE 0x04 /* 4 plane planar mode */
- #define VESA_MEM_PACKED_PIXEL 0x08 /* packed pixel mode */
- #define VESA_MEM_UNPACKED_PIXEL 0x10 /* 256 color unpacked pixel mode*/
-
- extern int VESAVersion();
- extern char *VESAVendorData();
- extern unsigned short *VESAModeTable();
- extern VESAModeInfo *VESABiosGetModeInfo(unsigned short);
- extern int VESABiosSetMode(int);
- extern int VESABiosGetMode();
- #endif /* VESABIOS_H */
-